package com.junjie.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class ApplicationContextConfig {
    @Bean
    @LoadBalanced // 启用负载均衡设置(这里启用之后默认是轮询的模式)
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
